package com.xbjtech.ticketsystem.model;

import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * @author leejun.happy@gmail.com
 * @created 2019/2/20
 */
@Table(name = "t_role")
@Data
public class Role implements Serializable {

    private static final long serialVersionUID = -8372332150249430271L;

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(name = "rid")
    private Integer id;

    @Column(name = "rname")
    private String name;

    @Transient
    private Set<User> users = new HashSet<>();

    @Transient
    private Set<Resource> resources = new HashSet<>();
}
